﻿using System;
using System.Data;
using System.Data.SqlClient;
using PPIProxy.PPIWebservice;

namespace PPIProxy
{
    public class WVendor_Visit_XMissionStructure
    {
        #region Query
        public static DataSet GetServerVisits(string connectionKey)
        {
            PPIProxy.PPIWebservice.PPIWebServiceClass serv = new PPIService();
            return serv.Vendor_Visit_XMission_Structure_GetServerVisits(connectionKey);
        }

        public static DataSet GetServerVisitsByID(int structureID, string connectionKey)
        {
            PPIProxy.PPIWebservice.PPIWebServiceClass serv = new PPIService();
            return serv.Vendor_Visit_XMission_Structure_GetServerVisitsByID(structureID, connectionKey);
        }

        public static DataSet GetServerVisitsByQueryAsset(int queryAsset, string connectionKey)
        {
            PPIProxy.PPIWebservice.PPIWebServiceClass serv = new PPIService();
            return serv.Vendor_Visit_XMission_Structure_GetServerVisitsByQueryAsset(queryAsset, connectionKey);

        }

        public static DataSet GetServerVisitsByUtilityID(int utilityID, string connectionKey)
        {
            PPIProxy.PPIWebservice.PPIWebServiceClass serv = new PPIService();
            return serv.Vendor_Visit_Xmission_Structure_GetServerVisitsByUtilityID(utilityID, connectionKey);
        }

        public static int GetTotal(string connectionKey)
        {
            PPIProxy.PPIWebservice.PPIWebServiceClass serv = new PPIService();
            return serv.Vendor_Visit_XMission_Structure_GetTotal(connectionKey);
        }

        #endregion Query

        #region Crud

        public static Int32 Insert(Int32 Vendor_ProjectID, Int32 Utility_Asset_XMissionStructureID, Int32 Vendor_Visit_TypeID, Int32 XMissionStructures_TopTypeID, double Latitude, double Logitude, double Alititude, Int32 SatelliteCount, DateTime SatelliteTime, bool SolutionAvaible, Int32 Handheld, Int32 Vendor_ContactID, DateTime date, int countImages, string connectionKey)
        {
            PPIProxy.PPIWebservice.PPIWebServiceClass serv = new PPIService();
            return
                serv.Vendor_Visit_XMission_Structure_Insert(Vendor_ProjectID, Utility_Asset_XMissionStructureID,
                                                            Vendor_Visit_TypeID, XMissionStructures_TopTypeID, Latitude,
                                                            Logitude, Alititude, SatelliteCount, SatelliteTime,
                                                            SolutionAvaible, Handheld, Vendor_ContactID, date,
                                                            countImages, connectionKey);
        }

        public static void Update(Int32 structureID, Int32 Vendor_ProjectID, Int32 Utility_Asset_XMissionStructureID, Int32 Vendor_Visit_TypeID, Int32 XMissionStructures_TopTypeID, double Latitude, double Logitude, double Alititude, Int32 SatelliteCount, DateTime SatelliteTime, bool SolutionAvaible, Int32 Handheld, Int32 Vendor_ContactID, DateTime date, int countImages, string connectionKey)
        {
            PPIProxy.PPIWebservice.PPIWebServiceClass serv = new PPIService();
            
                serv.Vendor_Visit_XMission_Structure_Update(structureID, Vendor_ProjectID,
                                                            Utility_Asset_XMissionStructureID,
                                                            Vendor_Visit_TypeID, XMissionStructures_TopTypeID, Latitude,
                                                            Logitude, Alititude, SatelliteCount, SatelliteTime,
                                                            SolutionAvaible, Handheld, Vendor_ContactID, date,
                                                            countImages, connectionKey);
        }

        public static void Delete(int structureID, string connectionKey)
        {
            PPIProxy.PPIWebservice.PPIWebServiceClass serv = new PPIService();
            serv.Vendor_Visit_XMission_Structure_Delete(structureID, connectionKey);
        }

        public static void UpdateUtility(Int32 structureID, Int32 utilityId, string connectionKey)
        {
            PPIProxy.PPIWebservice.PPIWebServiceClass serv = new PPIService();
            serv.Vendor_Visit_XMission_Structure_UpdateUtility(structureID, utilityId, connectionKey);
        }
        #endregion

    }
}
